//
//  HZL_FindTableViewCell.m
//  B_Project
//
//  Created by dllo on 15/11/26.
//  Copyright © 2015年 HZL. All rights reserved.
//

#import "HZL_FindTableViewCell.h"
#import "HZL_FindTypeCollectionViewCell.h"

@interface HZL_FindTableViewCell ()<UICollectionViewDataSource, UICollectionViewDelegate>
@property (nonatomic, retain) UICollectionView *collectionView;
@end

@implementation HZL_FindTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createCollection];
    }
    return self;
}
- (void)setModel:(HZL_FindModel *)model
{
    
}
- (void)createCollection
{
    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init];
    layout.itemSize = CGSizeMake(375 / 2 - 1, 45);
    layout.minimumInteritemSpacing = 1;
    layout.minimumLineSpacing = 1;
    // 竖滑
    layout.scrollDirection = UICollectionViewScrollDirectionVertical;
    self.collectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, 375, 90) collectionViewLayout:layout];
    //[self.contentView addSubview:self.collectionView];
    // 隐藏滚动条
    self.collectionView.showsVerticalScrollIndicator = NO;
    [self.contentView addSubview:self.collectionView];
//    self.collectionView.backgroundColor = [UIColor blueColor];
    self.collectionView.delegate = self;
    self.collectionView.dataSource = self;
    [self.collectionView registerClass:[HZL_FindTypeCollectionViewCell class] forCellWithReuseIdentifier:@"item"];
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 4;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    HZL_FindTypeCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"item" forIndexPath:indexPath];
    cell.backgroundColor = [UIColor blueColor];
    return cell;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
